<?php

class FormLabel extends FormControl {

	public static $property = array(
		'wbtype',
		'name',
		'caption',
		'x',
		'y',
		'width',
		'height',
		'multiline',
		'disabled',
		'ellipsis',
		'align',
		'valign',
		'border',
		'visible'
	);
	
	public function __construct() { 
		parent::__construct(array(
			'wbtype' => 'Label',
			'x' => 0,
			'y' => 0,
			'width' => 100,
			'height' => 30,
			'caption' => 'this is label',
			'style' => wbconstant('left middle'),
			'line' => 1
		));
	}
	
	/**
	 * 컨트롤 그리기 
	 * 
	 * @param WBGraphics $graphics
	 */
	public function displayControl(WBGraphics $g) {

		$xstart = $this->getOption('x');
		$ystart = $this->getOption('y');
		$width = $this->getOption('width');
		$height = $this->getOption('height');		
		$caption = $this->getOption('caption');		
		$style = WBC_LEFT | WBC_MIDDLE;		
		
		$font = ($this['disabled']) ? self::$disabledFont : self::$realFont ;
		
		$g->text($caption, $xstart, $ystart, $width, $height, $font, $style );
	}
	
	
	public function getProperty() { 
		return self::$property;
	}	
}


?>